Python program to count the number of times a character appears in a given string using a dictionary